function nm = expan_create_notematrix(pitch, onsets, offsets, hop, fs)

for i=1:length(onsets)
   onset_time = onsets(i)/fs;
   
   duration_time = (offsets(i) - onsets(i))/fs;
   
   pitch_hz = pitch(floor((onsets(i)+offsets(i))/(2*hop)));
   pitch_midi = hz2midi(pitch_hz);

    nm(i,:)=[onset_time duration_time 1 pitch_midi 127 onset_time duration_time];
end